package com.cola.action;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.cola.dao.CommonDao;
import com.cola.entity.City;
import com.cola.entity.export.ExportGoodsPrice;
import com.cola.entity.goods.TempGoods;
import com.cola.enums.ImportType;
import com.cola.service.CommonService;
import com.cola.service.GoodsPriceService;
import com.cola.service.GoodsService;
import com.cola.utils.DateUtils;
import com.cola.utils.Struts2Utils;
import com.cola.utils.excel.ExcelUtils;
import org.apache.commons.lang3.StringUtils;
import org.wuwz.poi.ExcelKit;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商品管理Action
 * @author Max
 * @since 2017/9/6
 */
public class GoodsAction extends BaseAction{
    private String goods_name; //商品名称
    private String goods_price;//商品价格
    private String sale_area; //销售区域
    private String goods_img;//商品主图
    private String goods_imgs;//商品图片
    private String goods_unit;//单位
    private String goods_brand_no;//品牌
    private String goods_type_no;//商品类型
    private String goods_specifications_no;//商品规格
    private String desc;//描述
    private Integer goods_id;//商品id
    private Integer offset;//起始位置
    private Integer limit;//页面大小
    private Integer is_sale;//是否促销
    private Integer buy_num;//购买数量
    private Integer giveaway_num;//赠品数量
    private String goods_json;//商品json
    //网络文件URl
    private String fileUrl;
    //文件名
    private String filename;
    private String goods_no;

    /**
     * 跳转到商品列表页
     * @author Max
     * @since 2017/9/6
     */
    public String toGoodsList(){
        setRequestAttribute("areaList", CommonService.getInstance().getAreaList());
        setRequestAttribute("brandList", CommonService.getInstance().getBrandList());
        setRequestAttribute("goodsTypeList", CommonService.getInstance().getGoodsTypeList());
        setRequestAttribute("goodsUnitList", CommonService.getInstance().getGoodsUnitList());
        return SUCCESS;
    }

    /**
     * 跳转到添加商品页面
     * @author Max
     * @since 2017/9/6
     */
    public String toAddGoods(){
//      setRequestAttribute("areaList", CommonService.getInstance().getAreaList());
        setRequestAttribute("brandList", CommonService.getInstance().getBrandList());
        setRequestAttribute("goodsTypeList", CommonService.getInstance().getGoodsTypeList());
        setRequestAttribute("goodsUnitList", CommonService.getInstance().getGoodsUnitList());
        setRequestAttribute("cityList", JSON.toJSONString(CommonService.getInstance().getCityAreaList()));
        return SUCCESS;
    }

    /**
     * 查询商品信息
     * @author Max
     * @since 2017/9/6
     */
    public void getGoodsList(){
        Map<String,Object> resultMap = new HashMap<String,Object>();

        resultMap.put("rows",GoodsService.getInstance().getGoodsList(offset,limit,getSearchGoodsFilter()));

        resultMap.put("total",GoodsService.getInstance().getGoodsCount(getSearchGoodsFilter()));

        Struts2Utils.renderJson(resultMap);
    }

    private Integer check_status =0;
    private String mini_date;
    private String max_date;
    private BigDecimal goods_mini_price = new BigDecimal("0");
    private BigDecimal goods_max_price  = new BigDecimal("0");

    /**
     * 获取搜索商品条件
     * @author Max
     * @since 2017/9/6
     */
    private String getSearchGoodsFilter(){
        StringBuilder filter = new StringBuilder("");

        if(StringUtils.isNotEmpty(goods_name)){
            filter.append(" and a.goods_name like '%").append(goods_name).append("' ");
        }

        if(StringUtils.isNotEmpty(goods_no)){
            filter.append(" and a.goods_no ='").append(goods_no).append("' ");
        }

        if(check_status>-2){
            filter.append(" and a.check_status = '").append(check_status).append("' ");
        }

        if(StringUtils.isNotEmpty(goods_brand_no)){
            filter.append(" and a.goods_brand_no = '").append(goods_brand_no).append("' ");
        }

        if(StringUtils.isNotEmpty(goods_type_no)){
            filter.append(" and a.goods_type_no = '").append(goods_type_no).append("' ");
        }

        return filter.toString();
    }


    /**
     * 导入物料编号信息
     * @author Max
     * @since 2017/9/6
     */
    public void importGoodsInfo(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        List<List<String>> importGoodsList = ExcelUtils.readExcel(fileUrl);
        Map<String,String> checkResultMap = GoodsService.getInstance().checkImportGoodsIsRight(importGoodsList);
        if(checkResultMap.containsKey("result") && "success".equals(checkResultMap.get("result"))){
            resultMap = GoodsService.getInstance().importGoodsInfo(importGoodsList,fileUrl,getUserName(),filename,getUserId());
            Struts2Utils.renderJson(resultMap);
        }else{
            CommonDao.getInstance().addImportLog(getUserId(), ImportType.MEP_IMPORT.getDesc(),filename,fileUrl,getUserName(),
                    0,-1,-1,-1,checkResultMap.get("msg"));
            Struts2Utils.renderJson(checkResultMap);
        }
    }

    /**
     * 添加商品
     * @author Max
     * @since 2017/9/6
     */
    public void addGoods(){
        Map<String,Object> goodsMap = new HashMap<String,Object>();

        TempGoods tempGoods = JSONObject.parseObject(goods_json,new TypeReference<TempGoods>(){});

        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().addGoods(tempGoods)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 商品上架
     * @author Max
     * @since 2017/9/6
     */
    public void goodsOn(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().goodsOn(goods_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 商品下架
     * @author Max
     * @since 2017/9/6
     */
    public void goodsOff(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().goodsOff(goods_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 商品删除
     * @author Max
     * @since 2017/9/6
     */
    public void goodsDelete(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().goodsDelete(goods_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 获取促销信息
     * @author Max
     * @since 2017/9/6
     */
    public void getGoodsSaleInfo(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        Map<String,Object> saleInfoMap = GoodsService.getInstance().getGoodsSaleInfo(goods_id);
        if(saleInfoMap!=null){
            resultMap.put("result","success");
            resultMap.put("data",saleInfoMap);
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);

    }

    /**
     * 跳转到编辑页面
     * @author Max
     * @since 2017/9/6
     */
    public String toEditGoods(){
        Map<String,Object> goodsInfoMap = GoodsService.getInstance().getGoodsInfoByGoodsId(goods_id);
        if(goodsInfoMap!=null){
            goodsInfoMap.put("result","success");
        }else{
            goodsInfoMap = new HashMap<String,Object>();
            goodsInfoMap.put("result","error");
        }
        setRequestAttribute("cityList", CommonService.getInstance().getCityList());
        setRequestAttribute("brandList", CommonService.getInstance().getBrandList());
        setRequestAttribute("goodsTypeList", CommonService.getInstance().getGoodsTypeList());
        setRequestAttribute("goodsSpecList", CommonService.getInstance().getGoodsSpecList());
        setRequestAttribute("goodsInfo",goodsInfoMap);
        return SUCCESS;
    }

    /**
     * 更新商品信息
     * @author Max
     * @since 2017/9/6
     */
    public void updateGoodsInfo(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        Map<String,Object> goodsInfoMap = getUpdateGoodsInfoMap();
        if(GoodsService.getInstance().updateGoodsInfoByGoodsId(goodsInfoMap,goods_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 获取更新商品的信息
     * @author Max
     * @since 2017/9/6
     */
    private Map<String,Object> getUpdateGoodsInfoMap(){
        Map<String,Object> goodsInfoMap = new HashMap<String,Object>();
        if(StringUtils.isNotEmpty(goods_name)){
            goodsInfoMap.put("goods_name",goods_name);
        }

        if(StringUtils.isNotEmpty(goods_img)){
            goodsInfoMap.put("goods_img",goods_img);
        }

        if(StringUtils.isNotEmpty(goods_imgs)){
            goodsInfoMap.put("goods_imgs",goods_imgs);
        }

        if(StringUtils.isNotEmpty(goods_brand_no)){
            goodsInfoMap.put("goods_brand",goods_brand_no);
        }

        if(StringUtils.isNotEmpty(goods_type_no)){
            goodsInfoMap.put("goods_type",goods_type_no);
        }

        if(StringUtils.isNotEmpty(goods_specifications_no)){
            goodsInfoMap.put("goods_specifications_no",goods_specifications_no);
        }

        if(StringUtils.isNotEmpty(desc)){
            goodsInfoMap.put("desc",desc);
        }

        return goodsInfoMap;
    }



    //=================================赠品==========================================

    /**
     * 跳转到赠品列表页
     * @author Max
     * @since 2017/9/6
     */
    public String toGiveawayList(){
        setRequestAttribute("brandList", CommonService.getInstance().getBrandList());
        setRequestAttribute("goodsTypeList", CommonService.getInstance().getGoodsTypeList());
        return SUCCESS;
    }


    /**
     * 跳转到添加赠品页面
     * @author Max
     * @since 2017/9/6
     */
    public String toAddGiveaway(){
        setRequestAttribute("areaList", CommonService.getInstance().getAreaList());
        setRequestAttribute("brandList", CommonService.getInstance().getBrandList());
        setRequestAttribute("goodsTypeList", CommonService.getInstance().getGoodsTypeList());
        setRequestAttribute("goodsUnitList", CommonService.getInstance().getGoodsUnitList());
        setRequestAttribute("goodsSpecList", CommonService.getInstance().getGoodsSpecList());
        return SUCCESS;
    }

    /**
     * 查询商品信息
     * @author Max
     * @since 2017/9/6
     */
    public void getGiveawayList(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        resultMap.put("rows",GoodsService.getInstance().getGiveawayList(offset,limit,getSearchGiveawayFilter()));

        resultMap.put("total",GoodsService.getInstance().getGiveawayCount(getSearchGiveawayFilter()));

        Struts2Utils.renderJson(resultMap);
    }

    private String giveaway_name;
    private String giveaway_img;
    private String giveaway_imgs;
    private String giveaway_unit_no;
    private String giveaway_brand_no;
    private String giveaway_type_no;
    private String giveaway_specifications_no;
    private Integer giveaway_id;
    private String giveaway_no;
    /**
     * 添加赠品
     * @author Max
     * @since 2017/9/6
     */
    public void addGiveaway(){
        Map<String,Object> giveawayMap = new HashMap<String,Object>();
        giveawayMap.put("giveaway_no",giveaway_no);
        giveawayMap.put("giveaway_name",giveaway_name);
        giveawayMap.put("giveaway_img",giveaway_img);
        giveawayMap.put("giveaway_imgs",giveaway_imgs);
        giveawayMap.put("giveaway_unit_no",giveaway_unit_no);
        giveawayMap.put("giveaway_brand_no",giveaway_brand_no);
        giveawayMap.put("giveaway_type_no",giveaway_type_no);
        giveawayMap.put("giveaway_specifications_no",giveaway_specifications_no);
        giveawayMap.put("desc",desc);

        Map<String,Object> resultMap = new HashMap<String,Object>();

        if(GoodsService.getInstance().addGiveaway(giveawayMap)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 获取搜索赠品条件
     * @author Max
     * @since 2017/9/6
     */
    private String getSearchGiveawayFilter(){
        StringBuilder filter = new StringBuilder("");
        if(StringUtils.isNoneEmpty(giveaway_no)){
            filter.append(" and giveaway_no = '").append(giveaway_no).append("' ");
        }

        if(StringUtils.isNoneEmpty(giveaway_brand_no)){
            filter.append(" and giveaway_brand_no = '").append(giveaway_brand_no).append("' ");
        }

        if(StringUtils.isNoneEmpty(giveaway_type_no)){
            filter.append(" and giveaway_type_no = '").append(giveaway_type_no).append("' ");
        }
        return filter.toString();
    }

    /**
     * 赠品上架
     * @author Max
     * @since 2017/9/6
     */
    public void giveawayOn(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().giveawayOn(giveaway_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 赠品下架
     * @author Max
     * @since 2017/9/6
     */
    public void giveawayOff(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().giveawayOff(giveaway_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);

    }
    /**
     * 赠品删除
     * @author Max
     * @since 2017/9/6
     */
    public void giveawayDelete(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsService.getInstance().giveawayDelete(giveaway_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);

    }



    //===============================================商品价格管理=============================================

    /**
     * 跳转到商品价格列表
     * @author Max
     * @since 2017/9/11
     */
    public String toGoodsPriceList(){
        List<City> list = CommonService.getInstance().getCityAreaList();
        setRequestAttribute("cityAreaList", list);
        setRequestAttribute("cityAreaListJson", JSON.toJSONString(list));
        setRequestAttribute("channelList", CommonService.getInstance().getChannelList());
        return SUCCESS;
    }

    /**
     * 获取商品价格信息列表
     * @author Max
     * @since 2017/9/11
     */
    public void getGoodsPriceList(){
        Map<String,Object> resultMap = new HashMap<String,Object>();

        resultMap.put("rows", GoodsPriceService.getInstance().getGoodsPriceList(offset,limit,getGoodsPriceFilter()));

        resultMap.put("total",GoodsPriceService.getInstance().getGoodsPriceListCount(getGoodsPriceFilter()));

        Struts2Utils.renderJson(resultMap);

    }

    private Integer config_id;

    /**
     * 根据物料id获取价格配置信息
     * @author Max
     * @since 2017/9/11
     */
    public void getGoodsPriceById(){
        Map<String,Object> resultMap = GoodsPriceService.getInstance().getGoodsPriceById(config_id);
        if(resultMap!=null){
            resultMap.put("result","success");
        }else{
            resultMap = new HashMap<String,Object>();
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 保存商品价格信息修改
     * @author Max
     * @since 2017/9/11
     */
    public void saveGoodsPriceConfig(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsPriceService.getInstance().saveGoodsPriceConfig(config_id,new BigDecimal(goods_price))){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }

    /**
     * 导入物料价格信息
     * @author Max
     * @since 2017/9/11
     */
    public void importGoodsPriceInfo(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        List<List<String>> importGoodsPriceList = ExcelUtils.readExcel(fileUrl);

        Map<String,String> checkResultMap = GoodsPriceService.getInstance().checkImportDate(importGoodsPriceList);
        //检查excel表格中价格区间是否一致
        if(checkResultMap.containsKey("result") && "success".equals(checkResultMap.get("result"))){
            checkResultMap =  GoodsPriceService.getInstance().checkEffectiveDate(importGoodsPriceList);
            //检查excel表格中价格有效期是否与数据库中无间断
            if(checkResultMap.containsKey("result") && "success".equals(checkResultMap.get("result"))){
                if(GoodsPriceService.getInstance().insertGoodsPrice(importGoodsPriceList)){
                    resultMap.put("result","success");
                }else{
                    resultMap.put("result","error");
                    resultMap.put("msg","系统内部错误");
                }
                Struts2Utils.renderJson(resultMap);
            }else{
                CommonDao.getInstance().addImportLog(getUserId(), ImportType.GOODS_PRICE_IMPORT.getDesc(),filename,fileUrl,getUserName(),
                        0,-1,-1,-1,checkResultMap.get("msg"));
                Struts2Utils.renderJson(checkResultMap);
            }
        }else{
            CommonDao.getInstance().addImportLog(getUserId(), ImportType.GOODS_PRICE_IMPORT.getDesc(),filename,fileUrl,getUserName(),
                    0,-1,-1,-1,checkResultMap.get("msg"));
            Struts2Utils.renderJson(checkResultMap);
        }
    }


    /**
     * 停用物料价格
     * @author Max
     * @since 2017/9/11
     */
    public void doGoodsPriceOff(){
        Map<String,Object> resultMap = new HashMap<String,Object>();
        if(GoodsPriceService.getInstance().doGoodsPriceOff(config_id)){
            resultMap.put("result","success");
        }else{
            resultMap.put("result","error");
        }
        Struts2Utils.renderJson(resultMap);
    }


    /**
     * 获取价格导出数据
     * @author Max
     * @since 2017/9/11
     */
    public void getExportGoodsPriceInfo(){
        List<ExportGoodsPrice> list = GoodsPriceService.getInstance().getExportGoodsPriceInfo();
        ExcelKit.$Export(ExportGoodsPrice.class,getResponse()).toExcel(list, "物料价格信息");
    }

    private String sale_city_no;

    private String sale_area_no;

    private String channel_no;

    /**
     * 获取搜索条件
     * @return String 搜索条件
     * @author Max
     * @since 2017/9/11
     */
    private String getGoodsPriceFilter(){
        StringBuilder filter = new StringBuilder("");

        if(StringUtils.isNotEmpty(goods_no)){
            filter.append(" and a.goods_no ='").append(goods_no).append("' ");
        }
        if(StringUtils.isNotEmpty(sale_city_no)){
            filter.append(" and a.sale_city_no ='").append(sale_city_no).append("' ");
        }
        if(StringUtils.isNotEmpty(sale_area_no)){
            filter.append(" and a.sale_area_no ='").append(sale_area_no).append("' ");
        }
        if(StringUtils.isNotEmpty(channel_no)){
            filter.append(" and a.sale_channel_no ='").append(channel_no).append("' ");
        }
        if(check_status>0){
            String nowDate = DateUtils.getCurrentDateTime();
            switch (check_status){
                case 1: filter.append(" and a.check_status =1 and a.start_time<='").append(nowDate)
                        .append("' and a.end_time>='").append(nowDate).append("' ");break;

                case 2: filter.append(" and a.check_status =-1 ");break;

                case 3: filter.append(" and a.check_status =1 and a.start_time>'").append(nowDate).append("'");break;

                case 4: filter.append(" and a.check_status =1 and a.end_time<'").append(nowDate).append("'");break;
            }
        }
        System.out.println(filter);
        return filter.toString();
    }

    public static void main(String[] args) {
        System.out.println("2017-01-01 12:00:00".compareTo("2017-01-01 12:00:00"));
    }




    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public String getGoods_price() {
        return goods_price;
    }

    public void setGoods_price(String goods_price) {
        this.goods_price = goods_price;
    }

    public String getSale_area() {
        return sale_area;
    }

    public void setSale_area(String sale_area) {
        this.sale_area = sale_area;
    }

    public String getGoods_img() {
        return goods_img;
    }

    public void setGoods_img(String goods_img) {
        this.goods_img = goods_img;
    }

    public String getGoods_imgs() {
        return goods_imgs;
    }

    public void setGoods_imgs(String goods_imgs) {
        this.goods_imgs = goods_imgs;
    }

    public String getGoods_unit() {
        return goods_unit;
    }

    public void setGoods_unit(String goods_unit) {
        this.goods_unit = goods_unit;
    }

    public String getGoods_brand_no() {
        return goods_brand_no;
    }

    public void setGoods_brand_no(String goods_brand_no) {
        this.goods_brand_no = goods_brand_no;
    }

    public String getGoods_type_no() {
        return goods_type_no;
    }

    public void setGoods_type_no(String goods_type_no) {
        this.goods_type_no = goods_type_no;
    }

    public String getGoods_specifications_no() {
        return goods_specifications_no;
    }

    public void setGoods_specifications_no(String goods_specifications_no) {
        this.goods_specifications_no = goods_specifications_no;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getGiveaway_name() {
        return giveaway_name;
    }

    public void setGiveaway_name(String giveaway_name) {
        this.giveaway_name = giveaway_name;
    }

    public String getGiveaway_img() {
        return giveaway_img;
    }

    public void setGiveaway_img(String giveaway_img) {
        this.giveaway_img = giveaway_img;
    }

    public String getGiveaway_imgs() {
        return giveaway_imgs;
    }

    public void setGiveaway_imgs(String giveaway_imgs) {
        this.giveaway_imgs = giveaway_imgs;
    }

    public Integer getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(Integer goods_id) {
        this.goods_id = goods_id;
    }

    public Integer getGiveaway_id() {
        return giveaway_id;
    }

    public void setGiveaway_id(Integer giveaway_id) {
        this.giveaway_id = giveaway_id;
    }

    public Integer getIs_sale() {
        return is_sale;
    }

    public void setIs_sale(Integer is_sale) {
        this.is_sale = is_sale;
    }

    public Integer getBuy_num() {
        return buy_num;
    }

    public void setBuy_num(Integer buy_num) {
        this.buy_num = buy_num;
    }

    public Integer getGiveaway_num() {
        return giveaway_num;
    }

    public void setGiveaway_num(Integer giveaway_num) {
        this.giveaway_num = giveaway_num;
    }

    public Integer getCheck_status() {
        return check_status;
    }

    public void setCheck_status(Integer check_status) {
        this.check_status = check_status;
    }

    public String getMini_date() {
        return mini_date;
    }

    public void setMini_date(String mini_date) {
        this.mini_date = mini_date;
    }

    public String getMax_date() {
        return max_date;
    }

    public void setMax_date(String max_date) {
        this.max_date = max_date;
    }

    public BigDecimal getGoods_mini_price() {
        return goods_mini_price;
    }

    public void setGoods_mini_price(BigDecimal goods_mini_price) {
        this.goods_mini_price = goods_mini_price;
    }

    public BigDecimal getGoods_max_price() {
        return goods_max_price;
    }

    public void setGoods_max_price(BigDecimal goods_max_price) {
        this.goods_max_price = goods_max_price;
    }

    public String getGoods_json() {
        return goods_json;
    }

    public void setGoods_json(String goods_json) {
        this.goods_json = goods_json;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getGoods_no() {
        return goods_no;
    }

    public void setGoods_no(String goods_no) {
        this.goods_no = goods_no;
    }

    public String getSale_city_no() {
        return sale_city_no;
    }

    public void setSale_city_no(String sale_city_no) {
        this.sale_city_no = sale_city_no;
    }

    public String getSale_area_no() {
        return sale_area_no;
    }

    public void setSale_area_no(String sale_area_no) {
        this.sale_area_no = sale_area_no;
    }

    public String getChannel_no() {
        return channel_no;
    }

    public void setChannel_no(String channel_no) {
        this.channel_no = channel_no;
    }

    public Integer getConfig_id() {
        return config_id;
    }

    public void setConfig_id(Integer config_id) {
        this.config_id = config_id;
    }

    public String getGiveaway_unit_no() {
        return giveaway_unit_no;
    }

    public void setGiveaway_unit_no(String giveaway_unit_no) {
        this.giveaway_unit_no = giveaway_unit_no;
    }

    public String getGiveaway_brand_no() {
        return giveaway_brand_no;
    }

    public void setGiveaway_brand_no(String giveaway_brand_no) {
        this.giveaway_brand_no = giveaway_brand_no;
    }

    public String getGiveaway_type_no() {
        return giveaway_type_no;
    }

    public void setGiveaway_type_no(String giveaway_type_no) {
        this.giveaway_type_no = giveaway_type_no;
    }

    public String getGiveaway_specifications_no() {
        return giveaway_specifications_no;
    }

    public void setGiveaway_specifications_no(String giveaway_specifications_no) {
        this.giveaway_specifications_no = giveaway_specifications_no;
    }

    public String getGiveaway_no() {
        return giveaway_no;
    }

    public void setGiveaway_no(String giveaway_no) {
        this.giveaway_no = giveaway_no;
    }
}
